package com.hh.demo.service;
import com.hh.demo.entity.Book;
import com.hh.demo.entity.Bookinfo;
import com.hh.demo.mapper.BookMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 吉吉国王
 * @since 2022-07-11
 */
@Service
public class BookService{
    @Resource
    private BookMapper bookMapper;

    public List<Book> queryAll(){
      return bookMapper.queryAll();
    }
    public List<Bookinfo> queryBookCard(){
        return bookMapper.queryBookCard();
    }

    public List<Book> queryBookByBorrower(String borrower){
        return bookMapper.queryBookByBorrower(borrower);
    }
    public List<Book> queryBookBybookNo(String bookNo){
        return bookMapper.queryBookBybookNo(bookNo);
    }
    public List<Book> queryBookByborrowTime(String borrowTime){
        return bookMapper.queryBookByborrowTime(borrowTime);
    }
    public void insertBook(Book book){
        bookMapper.insertBook(book);
    }
    public void updateBook(String borrower,String returnDate){
        bookMapper.updateBook(borrower,returnDate);
    }
    public List<Book> queryCount(){
        return bookMapper.queryCount();
    }
}
